import 'package:json_annotation/json_annotation.dart';

part 'user_model.g.dart';


@JsonSerializable()
class UserModel extends Object {

  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'gender')
  String? gender;

  @JsonKey(name: 'nickname')
  String? nickname;

  @JsonKey(name: 'avatar')
  String? avatar;

  @JsonKey(name: 'openid')
  String? openid;

  @JsonKey(name: 'uid')
  String? uid;

  @JsonKey(name: 'ynNew')
  int? ynNew;

  @JsonKey(name: 'createdTime')
  int? createdTime;

  @JsonKey(name: 'sessionid')
  String? sessionid;

  @JsonKey(name: 'token')
  String? token;

  @JsonKey(name: 'cartoonCount')
  int? cartoonCount;

  @JsonKey(name: 'pipeCount')
  int? pipeCount;

  @JsonKey(name: 'setting')
  UserSetting? setting;

  UserModel(this.id,this.gender,this.nickname,this.avatar,this.openid,this.uid,this.ynNew,this.createdTime,this.sessionid,this.token,this.cartoonCount,this.pipeCount,this.setting);

  factory UserModel.fromJson(Map<String, dynamic> srcJson) => _$UserModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$UserModelToJson(this);

}

@JsonSerializable()
class UserSetting extends Object {

  @JsonKey(name: 'avatarFrame')
  String? avatarFrame;

  UserSetting(this.avatarFrame,);

  factory UserSetting.fromJson(Map<String, dynamic> srcJson) => _$UserSettingFromJson(srcJson);

  Map<String, dynamic> toJson() => _$UserSettingToJson(this);

}


